<div class="row">
  <div class="col-md-12"> 
    <!-- 导航 -->
    <nav class="navbar navbar-inverse">
      <div class="container-fluid"> 
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
          <a class="navbar-brand" href="#">{$sitename|default="后台"}</a> </div>
        
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">
             {if $Think.session.user_id} 
                <li><a href="#">{$Think.session.user_name}</a></li>
                <li><a href="{:url('User/logout')}">退出登录</a></li>           
                <li><a href="{:url('admin/Index/index')}">后台管理</a></li>
              {else/}
              <li><a href="{:url('User/login')}">登录</a></li>
              <li><a href="{:url('User/register')}">注册</a></li>
              {/if}
          </ul>
        </div>
        <!-- /.navbar-collapse --> 
      </div>
      <!-- /.container-fluid --> 
    </nav>
  </div>     
</div>